﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EONFULLSIN.Utils
{
    public class ParseHelper
    {
        //i：输入电流 Smin~Smax测量范围
        public static double MapValue(double I, double Smin, double Smax)
        {
            // 输入范围
            double Imin = 4;
            double Imax = 20;

            // 线性映射公式
            double S = ((I - Imin) * (Smax - Smin)) / (Imax - Imin) + Smin;
            var result = Math.Round(S, 2);
            return result;
        }
    }
}
